home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
MENU-ITM.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
66 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME MENU-ITM.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
$INCLUDE "DAS-NB02.INC"
$INCLUDE "DAS-NBT1.INC"
$INCLUDE "DAS-NBT3.INC"
COLOR 7, 0, 0
CLS
? "┌──────────────────────────────────────────────────────────────────────────
? "│ fMenuItem?( Item$, NewItem$, OnOff?, NormAttr?, LtrAttr?, OffAttr? )
? "├──────────────────────────────────────────────────────────────────────────
? "│ Item$ is the incoming, unconverted menu item
? "│ NewItem$ is the converted menu item
? "│ OnOff? if 0 then the item is deemed to be OFF else it is ACTIVE
? "│ Nattr? normal item color attribute
? "│ Lattr? hot-letter color attribute
? "│ Oattr? off item color attribute
? "├──────────────────────────────────────────────────────────────────────────
? "│ This function is used by DDmenu and TmenuHOT when the hotkey style is 2.
? "│ It prepares the item string for printing with Tprint, extracts the letter
? "│ to be used as the hot-key and uses UCASEchar to convert it's value. This
? "│ is the value returned by the function. NewItem$ holds the newly created
? "│ string. The letter to be used as the hot-key should be preceded by an
? "│ underline CHR$(95). This character is removed in NewItem$
? "└──────────────────────────────────────────────────────────────────────────
DIM M$(2)
M$(0) = "_Hello _Howard" ' this doesn't work when item is OFF
M$(1) = "Hello World" ' this doesn't work well as no letter
M$(2) = "Hello _ralff" ' this is perfect!
Nattr? = 80 ' normal attr = black/magenta
Lattr? = 94 ' letter attr = YELLOW/magenta
Oattr? = 93 ' off attr = MAGENTA/magenta
Row? = 18
FOR M? = 0 TO 2
FOR OnOff? = 0 TO 1
HotKey? = fTmenuItem?( M$(M?), I$, OnOff?, Nattr?, Lattr?, Oattr? )
LOCATE Row?, 1
IF OnOff? = 0 THEN PRINT " ITEM OFF "; ELSE PRINT " ITEM ON ";
PRINT M$(M?); TAB( 30 ); USING$( "ASCII HOT KEY ###", HotKey? )
Tprint Row?, 50, I$, Nattr?
INCR Row?, 1
NEXT
NEXT